<template>
    <div class="container">
        <head-bar height="80" middleText="用户信息" :leftClick="returnPage"></head-bar>
        <wxc-cell :has-arrow="false" class="user-info-cell"
                  :has-top-border="true"
                  :auto-accessible="false">
            <image class="user-info-i"
                   slot="label"
                   src="root:img/userInfo/phone.png"></image>
            <text class="user-cell-name" slot="label">手机</text>
            <text class="user-info-t"  slot="title">{{info.mobile}}</text>
        </wxc-cell>
        <wxc-cell class="user-info-cell" :has-arrow="false"
                  :has-top-border="true"
                  :auto-accessible="false">
            <image class="user-info-i"
                   slot="label"
                   src="root:img/userInfo/email.png"></image>
            <text class="user-cell-name"  slot="label">邮箱</text>
            <text class="user-info-t" slot="title">{{info.email}}</text>
        </wxc-cell>
        <wxc-cell :has-arrow="false" class="user-info-cell"
                  :has-top-border="true"
                  :auto-accessible="false">
            <image class="user-info-i"
                   slot="label"
                   src="root:img/userInfo/department.png"></image>
            <text class="user-cell-name" slot="label">部门</text>
            <text class="user-info-t" slot="title">{{info.section_name}}</text>
        </wxc-cell>

    </div>
</template>

<style>
    .container {
        flex-direction: column-reverse;

    }


    .user-info-i{
        width:40px;
        height:40px;
    }
    .user-info-t{
        margin-left: 50px;
        font-size:30px;
    }

    .user-info-cell{
        height:100px;
    }

    .user-cell-name{
        color: #a8a8a8;
        margin-left: 20px;
        font-size:30px;
    }

</style>
<script>
    import headBar from '../components/headBar.vue'
    import {WxcCell} from 'weex-ui'
    import nw from '../network/nw.js'

    export default {
        components: {WxcCell,headBar},
        data() {
            return {
                info:{}
            }
        },
        methods: {

            //返回上个页面
            returnPage: function () {
                var nav = weex.requireModule('navigator')
                nav.back()
            }
        },

        mounted: function () {
            var self = this
            nw.postDefine('app/yxq/user/info',{
                success(res){
                    self.info = res
                }
            })
        },
    }
</script>